package com.zrrd.learn.chapter09.collection;

import java.util.HashMap;
import java.util.Map;

/**
 * 学习一下map
 *
 * @author wrn
 * @version 1.0
 * @date 2023/8/17 13:13
 */

public class LearnMap {

    public static void main(String[] args) {
        // hash结构 k,v k : key 主键 唯一
        Map<String,String> map =  new HashMap<>(2);
        map.put("name","xx");
        map.put("age","x12");
        System.out.println(map.containsValue("xx"));

//        char c = 0;
//        System.out.println(c);
//        String string1 = null;
//        System.out.println(string1);

        map.put(null,null);

        System.out.println(map.get(null));

        System.out.println(map.size());

        System.out.println(map);

        Map<String,String> map1 = new HashMap<>(2);
        map1.put("name","vv");
        System.out.println(map.size());
        System.out.println(map);

        map1.remove("name");
        System.out.println(map1);
//        List<Map<String,String>> list = new ArrayList<>();
//        list.add(map);
//        list.add(map1);

    }

}
